home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 4
/
Precision Software Applications Silver Collection Volume 4 (1993).iso
/
database
/
sr_info.exe
/
MENU.PRG
< prev
next >
Wrap
Text File
|
1990-05-14
|
3KB
|
85 lines
***************************************************************************
** MENU.PRG
** (C) Copyright 1990, Sub Rosa Publishing Inc.
** A demonstration program provided to SR-Info and VP-Info users.
** This program may be copied freely. If it is used in commercial code,
** please credit the source, Sub Rosa Publishing Inc.
**
** MENU demonstrates the use of the MENU() function along with a variety
** of Info commands and functions.
** Menu is compatible with all current versions of SR-Info and VP-Info.
**
** MENU displays a menu, determines the choice made, and takes
** action depending both on the selection and the key used to make
** the selection.
**
** Bernie Melman
** April 1,1990
***************************************************************************
IF :color <> 7
SET color to 31; white on blue
ENDIF
SET WIDTH to 80
COLOR :color,0,0,24,79,177 ;fill screen with pattern
* 177 is a fill character.
COLOR 112,7,20,21,66 ;draw black box to become shadow
WINDOW 6,18,19,62 DOUBLE COLOR :color ;declare space for menu text
ON escape
CURSOR 22,0
WINDOW
CANCEL
ENDON
DO WHILE t ;put main menu in an infinite loop
ERASE ;fills window with blanks
TEXT
DEMO MAIN MENU
0. Exit program and SR-Info.
1. Branch 1 of sample program.
2. Do not choose this option.
3. Branch 3 - choose with function key.
4. Do not choose this option.
5. Exit program - stay in SR-Info.
ENDTEXT
CURSOR 12,25 ; positions menu cursor over 1st character of 1st choice
selection=menu(5,37) ;five choices menu bar width 37
DO CASE
CASE selection=0 .or. :key=327 ; <home> key
QUIT
CASE selection=1
IF :key = 13
@ 20,21 say " CHOSEN WITH ENTER KEY! Press any key. "
ELSE
IF :key < 255
@ 20,21 say " CHOSEN WITH KEY "+chr(:key)+" Press any key. "
ELSE
@ 20,21 say " KEY WITH Info code "+str(:key,3)+" Press any key. "
ENDIF
ENDIF
dummy=inkey() ;wait for keystroke
@ 20,21 say blank(40,205)
CASE selection=3
IF (:key < 315) .or. (:key > 324)
@ 20,21 say " NOT A Function KEY! Press any key. "
ELSE
@ 20,21 say " CHOSEN WITH F"+str(:key-314,2)+". Press any key. "
ENDIF
DUMMY = inkey()
@ 20,21 say blank(40,205)
CASE selection=5
WINDOW ;reset window to full screen
ERASE ;clear screen
CURSOR 0,0; cursor to top left
CANCEL
OTHERWISE
@ 20,21 say " ILLEGAL CHOICE! Press any key. "
DUMMY = inkey()
@ 20,21 say blank(40,205) ;205 rebuilds double box
ENDCASE
ENDDO
*
* *** end of MENU.PRG ***